<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String root = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ root;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title><s:property value="article.title" />
		</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css"
			href="<%=root%>/style/articles.css">
		<style type="text/css">
<!--
.tooltip {
	padding-left: 30px;
	padding-top: 17px;
	width: 120px;
	height: 23px;
	background: transparent
		url(<%=root%>/scripts/jquery-tools/tooltip/tooltip.png);
	color: #ffffff;
	display: none;
}
-->
</style>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery-1.3.2.min.js"></script>
		<script src="<%=root%>/scripts/jquery-tools/js/jquery.tools.min.js"
			type="text/javascript"></script>
		<script src="<%=root%>/scripts/jquery.corner.js"
			type="text/javascript"></script>

		<script type="text/javascript">
			<!--
				$(function(){
					$(".pane").corner("10px");
						
						var floorCount=<s:property value="article.comments.size()"/>;
						
						var template="<p>"+
							'<span class="nickname">#name#</span><span class="comment_date"> at #writeDate# </span><span class="comment_ip">#ip#</span><span>说：</span><span class="floor_info">##floor#</span>'+
						"</p>"+
						"<div class='comment'>"+
							"<table>"+
								"<tr>"+
									"<td width=50 height=50 valign='top'>"+
										"<img src='<%=root%>/images/header_comment.png' />"+
									"</td>"+
									"<td>"+
										'#content#'+
									"</td>"+
								"</tr>"+
							"</table>"+
						"</div>";
						
						function showComment(data,el){
							floorCount++;
							var comment=template.replace('#name#',data.name).replace('#writeDate#',data.writeDate).replace('#ip#',data.ip).replace('#content#',data.content).replace('#floor#',floorCount);
							el.append(comment);
							el.corner("10px");
						}
						
					function sendComment(){
						$.ajax({
							url:'<%=root%>/system/commentSaver.action',
							data:{
								'articleId':$('#articleId').val(),
								'comment.name':$('#name_comment').val(),
								'comment.email':$('#email_comment').val(),
								'comment.page':$('#page_comment').val(),
								'comment.content':$('#content_comment').val()
							},
							dataType:'json',
							success:function(data){
								if(data.result){
									showComment(data,$('.article_comments'));
									$('#name_comment').val('');
									$('#email_comment').val('');
									$('#page_comment').val('');
									$('#content_comment').val('');
								}else{
									alert("：(  评论失败！");
								}
							}
						});
					}
					
					$('#submit_comment').click(function(e){
						sendComment();
					});
				});
			-->
			</script>
	</head>

	<body style="">
		<div class="show_zone">
			<div class="article_info">
				<div class="position_finger">
					当前位置
					<a>首页</a>》
					<a>文章</a>》
					<a>文学</a>》
					<a><s:property value="article.title" /> </a>
				</div>
				<div class="article_body pane">
					<h1>
						<s:property value="article.title" />
					</h1>
					<p class="keywords">
						关键词：
						<s:property value="article.keywords" />
					</p>
					<div class="article_meta">
						<p class="article_meta_date">
							发表日期：
							<s:date name="article.writeDate" format="yyyy-MM-dd HH:mm" />
							类别:
							<a><s:property value="article.catogoryName" />
							</a> 浏览 次数：
							<s:property value="article.readCount" />
						</p>
						<p class="article_meta_comment">
							<a href="#article_comments"><s:property
									value="article.comments.size()" /> </a>
							<a href="#comment_form">发表评论</a>
						</p>
					</div>
					<div class="article_content">
						<s:property value="article.text.value" escape="false" />
					</div>

					<div class="article_announce">
						本文地址：
						<a
							href='<%=basePath%>/system/articleRead.action?readArticle=<s:property value="article.id" />'><%=basePath%>/system/articleRead.action?readArticle=<s:property
								value="article.id" /> </a>
					</div>

					<div class="article_nagavite">
						<div class="previous_article">
							上一篇:
							<a>aaaaa</a>
						</div>
						<div class="next_article">
							下一篇:
							<a>没有了</a>
						</div>
					</div>
				</div>

				<div class="same_interest pane">
					<h1>
						您可能对他们也感兴趣:
					</h1>
					<ul>
						<li>
							<a>闰土1</a>
						</li>
						<li>
							<a>闰土1</a>
						</li>
						<li>
							<a>闰土1</a>
						</li>
						<li>
							<a>闰土1</a>
						</li>
						<li>
							<a>闰土1</a>
						</li>
					</ul>
				</div>


				<div class="article_comments pane" id="article_comments">
					<h1>
						有
						<s:property value="article.comments.size()" />
						位网友对这篇文章有点看法:-)
					</h1>
					<s:iterator value="article.comments" id="comment" status="status">
						<p>
							<span class="nickname"><s:property value="#comment.name" />
							</span><span class="comment_date"> at <s:date
									name="#comment.writeDate" format="yyyy-MM-dd hh:mm" /> </span><span
								class="comment_ip"><s:property value="#comment.ip" /> </span><span>说：</span><span
								class="floor_info">#<s:property value="#status.index+1" />
							</span>
						</p>
						<div class="comment" id='<s:property value="#comment.key.id"/>'>
							<table>
								<tr>
									<td width=50 height=50 valign="top">
										<img src="<%=root%>/images/header_comment.png" />
									</td>
									<td>
										<s:property value="#comment.content" />
									</td>
								</tr>
							</table>
						</div>
					</s:iterator>

				</div>

				<div class="commentor pane">
					<form name="comment_form" id="comment_form">
						<input name="articleId" id="articleId" type="hidden"
							value='<s:property value="article.id" />' />
						<div class="comment_item">
							<label>
								昵称：
							</label>
							<input name="comment.name" id="name_comment" />
						</div>
						<div class="comment_item">
							<label>
								邮件地址：
							</label>
							<input name="comment.email" id="email_comment" />
						</div>
						<div class="comment_item">
							<label>
								主页地址：
							</label>
							<input name="comment.page" id="page_comment" />
						</div>
						<div class="comment_item">
							<h3>
								评论(必填)
							</h3>
							<textarea name="comment.content" id="content_comment"></textarea>
						</div>
						<div class="comment_item">
							<input type="button" value="评论" class="submit_btn"
								id="submit_comment">
						</div>
					</form>
				</div>

			</div>
			<div class="other_info">
				<div class="latest_articles pane">
					<h3>
						最新文章：
					</h3>
					<ul>
						<s:iterator value="articlePageData.pageData" id="article"
							status="s">
							<s:if test="!(article.id==#article.id)">
								<li>
									<a
										href='<%=root%>/system/articleRead.action?readArticle=<s:property value="#article.id"/>'><s:property
											value="#article.title" />
									</a>
								</li>
							</s:if>
							<s:if test="#s.count=0">
								<li>
									暂时没有最新文章
								</li>
							</s:if>
						</s:iterator>
					</ul>
				</div>
				<div class="same_type_articles pane">
					<h3>
						文章分类：
					</h3>
					<ul>
						<s:if test="catogories.size()==0">
							<li>
								暂无分类
							</li>
						</s:if>
						<s:else>
							<s:iterator value="catogories" id="catogory" status="s">
								<li>
									<a
										href='<%=root%>/system/home.action?catogoryId=<s:property value="#catogory.id" />'>
										<s:property value="#catogory.name" /> </a>
								</li>
							</s:iterator>
						</s:else>
					</ul>
				</div>
				<div class="links pane">
					<h3>
						链接：
					</h3>
					<ul>
						<s:if test="links.size()==0">
							<li>
								暂无链接
							</li>
						</s:if>
						<s:else>
							<s:iterator value="links" id="link" status="s">
								<li>
									<a  target='_blank'
										href='<s:property value="#link.url" />'>
										<s:property value="#link.name" /> </a>
								</li>
							</s:iterator>
						</s:else>
					</ul>
				</div>
			</div>


		</div>
	</body>
</html>
